using UnityEngine;
using System.Collections;

public class EventSaveReset : MonoBehaviour {
	
	public enum type{
		SAVE,
		RESET
	}
	GUIButton button;
	public type operationType;
	//private int totalPerksCount;
	
	void Start ()
	{
		button = gameObject.GetComponent<GUIButton>();
		button.OnClickCallback += OnClick;
	//	totalPerksCount = Perks.Perk.GetPerksDictionary().Count;
	}
	
	void OnClick(Vector3 pos){
		switch(operationType){
		case type.SAVE:
			CharacterDataManager.GetInstance().SaveCharacters();
			break;
		case type.RESET:
			CharacterDataManager.GetInstance().ResetCharData();	
			
			AttributesController.GetInstance().SetActiveCharacter(
			CharacterDataManager.GetInstance().GetCurrentCharData().attributes);
			
			AttributesController.GetInstance().UpdateStats();
			break;
		}
	}
}